package com.hzbank.juc.introduction;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.TimeUnit;

/**
 * @description:
 * @author: libugu@cskaoyan.com
 * @date 2023/12/18 - 15:33
 */
@Slf4j
public class Sleep {
    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread("aaaa"){
            @Override
            public void run() {
                try {
                    Thread.sleep(2000);

                } catch (InterruptedException e) {

                    e.printStackTrace();
                }
            }
        };
        thread.start();
        log.debug("aaaaa1.thread{}====="+thread.getState());
        TimeUnit.SECONDS.sleep(1);
        log.debug("aaaaa2.thread{}====="+thread.getState());
    }
}
